package com.capgemini.cn.authority.rest.valueobject.data;

import com.capgemini.cn.authority.data.entity.GroupMembers;
import com.capgemini.cn.authority.data.entity.Groups;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.NoArgsConstructor;

import java.sql.Timestamp;

/**
 * Created at 2017/9/18
 *
 * @author Andriy
 */
@ApiModel(value = "用户组成员值对象")
@JsonSerialize
@JsonInclude(value = JsonInclude.Include.NON_NULL)
@NoArgsConstructor
public class GroupMemberVO extends GroupMembers {

    @JsonIgnore
    @Override
    public Groups getGroups() {
        return super.getGroups();
    }

    @ApiModelProperty(value = "所属用户组主键值")
    @JsonProperty(value = "groupId")
    public Long getGroupId() {
        return super.getGroups().getId();
    }

    @ApiModelProperty(value = "用户名")
    @Override
    public String getUserName() {
        return super.getUserName();
    }

    @ApiModelProperty(value = "用户组成员主键值")
    @Override
    public long getId() {
        return super.getId();
    }

    @ApiModelProperty(value = "用户组成员创建时间")
    @Override
    public Timestamp getCreateTime() {
        return super.getCreateTime();
    }

    @JsonIgnore
    @Override
    public Timestamp getUpdateTime() {
        return super.getUpdateTime();
    }
}
